<?php
namespace app\index\controller;
use think\Model;
use app\Capital\model\account;
use think\Db;
class Membercapital extends User{
    //会员账务显示
    public function index(){
        return $this->fetch();
    }
    public function member_capital(){
        $data=input();
        if($data['start'] && $data['end']){
            $start=strtotime($data['start']."0:00:00");
            $end=strtotime($data['end']."23:59:59");
          //  $where['createtime']=['between',[$start,$end]];
        }
      // $where['account_type']=$data['type'];
        if($data['user_type']){
           if('all' !=$data['user_type']){
               $where['type']=$data['user_type'];
           }
        }
        $where['memberid']=62;
        if($data['no']){
            $where['no']=trim($data['no']);
        }
        $user_type=account::$orderType;
        $result=Db::name('member_account')->where($where)->select();
        $html='';
        foreach($result as $value){
            $html.='<div class="address-item">
                    <div class="add-i-total m-bill-t-w1">'.date('Y-m-d',$value['createtime']).'</div>
                    <div class="add-i-total whitebar-t-w2">'.$user_type[$value['type']].'</div>
                    <div class="add-i-total whitebar-t-w3"><a style="color:blue;" href='.url('index').'>'.$value['no'].'</a></div>
                    <div class="add-i-total whitebar-t-w4">'.$value['member_name'].'</div>
                    <div class="add-i-total whitebar-t-w5">'.'1254556'.'</div>
                    <div class="add-i-total whitebar-t-w6">'.abs(getPrice($value['num'])).'</div>
                    <div class="add-i-total whitebar-t-w7">'.getPrice($value['num']).'</div>
                    <div class="add-i-total m-bill-t-w7">'.getPrice($value['balance']).'</div></div>';
        }
        return json($html);
    }
}